package io.admin.modules.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import io.admin.modules.item.dao.ItemDao;
import io.admin.modules.item.dto.ItemDTO;
import io.common.entity.ItemEntity;
import io.admin.modules.item.service.ItemService;
import cn.hutool.core.util.StrUtil;
import io.common.service.impl.CrudServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 商品表
 *
 * @author BS #
 * @since 1.0.0 2024-04-19
 */
@Service
public class ItemServiceImpl extends CrudServiceImpl<ItemDao, ItemEntity, ItemDTO> implements ItemService {

    @Override
    public QueryWrapper<ItemEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<ItemEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


}